var theApplet = null;
var p_chartType = 1;//模式切换
var p_onemenu_id;//一级菜单
var p_twomenu_id;//二级菜单
var p_threadmenu_id;//三级菜单

//java Applet的操作   
function getWWJApplet()
{
   if (theApplet == null) {
      theApplet = document.getElementById('wwjApplet');
   }
   try {
      theApplet = theApplet.getSubApplet();
   } catch (e) {
   }
   return theApplet;
}

  //调用港口..
  function onHarBourAll(noth,eh,zoom,hight,width){
	  getWWJApplet().gotoLatLon(noth,eh,zoom,hight,width)
  }

//指定要改变对象的css属性			
function updateOBJCSS(devid,cssname){
	 var obj =  document.getElementById(devid);
	 if(obj!=null){
		 obj.className = cssname
	 }
		 if(obj==AutoStationid||obj==Hydrologyid){getWWJApplet().getSiteShow();}
	else{getWWJApplet().getSitehide();}
	  
}




//不显示指定对象
function colsedObj(devid){
	if(devid==null||devid==''){
		return ;
	}
	var child_menuid_object = document.getElementById(devid);
	if(child_menuid_object!=null){           
	    child_menuid_object.className = "collapsed";
	}
	
}




//卫星模式
 function onSatellite(){  
		p_chartType=2;

	 getWWJApplet().earthShowSatellite()
  }    
  //海图模式			
 function onSeaChart(){  

		p_chartType=1;
		getWWJApplet().earthShowSeaChart();
       		  				 
}     

  //初始化模式
function getChartType(){  
       				
       return 2; 				
      			     
 }   




 function OpenWin(url){
          window.open(url, '_blank', 'height=400, width=450, top='+Math.round((window.screen.height-400)/3)+',left='+Math.round((window.screen.width-450)/2)+',toolbar=no, menubar=no, scrollbars=no, resizable=yes,location=no, status=no,z-look=yes');
     }
 
 
 
 //关闭一级菜单
 function colsedOneMenu(){
     // colsedObj(p_onemenu_id);
     // p_onemenu_id = null;
      colsedTwoMenu();
 }
 //关闭二级菜单
 function colsedTwoMenu(){
	 colsedObj(p_twomenu_id);
	 p_twomenu_id = null;
	 colsedThreadMenu();
 }
 
 //关闭三级菜单
  function colsedThreadMenu(){
	 colsedObj(p_threadmenu_id);
	 p_threadmenu_id =null;
 }

 function OpenWinOther(url){

         window.open(url, '_blank', 'height=450, width=700, top='+Math.round((window.screen.height-450)/3)+',left='+Math.round((window.screen.width-700)/2)+',toolbar=no, menubar=no, scrollbars=no, resizable=yes,location=no, status=yes,z-look=yes');
     }

 function onHangLu(){
        getWWJApplet().visibleTrack();
   }

//洋山港3D
function openys3d(url,height,width){
       					 var url = "../earth/c3d/qiaodong.htm"
window.open(url, 'newwindow',  'fullscreen=yes', 'height=100%, width=100%,toolbar=no, menubar=no, scrollbars=no, resizable=yes,location=no, status=no,');
}
